Optimal. Leaf size=106 \[ -\frac {x \left (3 a^2 d^2-2 a b c d+b^2 c^2\right )}{2 c^2 d \left (c+d x^2\right )}-\frac {a^2}{c x \left (c+d x^2\right )}+\frac {(b c-a d) (3 a d+b c) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}} \]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {462, 385, 205} \begin {gather*} -\frac {x \left (3 a^2 d^2-2 a b c d+b^2 c^2\right )}{2 c^2 d \left (c+d x^2\right )}-\frac {a^2}{c x \left (c+d x^2\right )}+\frac {(b c-a d) (3 a d+b c) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 385
Rule 462
Rubi steps
\begin {align*} \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx &=-\frac {a^2}{c x \left (c+d x^2\right )}+\frac {\int \frac {a (2 b c-3 a d)+b^2 c x^2}{\left (c+d x^2\right )^2} \, dx}{c}\\ &=-\frac {a^2}{c x \left (c+d x^2\right )}+\frac {\left (2 a b-\frac {b^2 c}{d}-\frac {3 a^2 d}{c}\right ) x}{2 c \left (c+d x^2\right )}+\frac {((b c-a d) (b c+3 a d)) \int \frac {1}{c+d x^2} \, dx}{2 c^2 d}\\ &=-\frac {a^2}{c x \left (c+d x^2\right )}+\frac {\left (2 a b-\frac {b^2 c}{d}-\frac {3 a^2 d}{c}\right ) x}{2 c \left (c+d x^2\right )}+\frac {(b c-a d) (b c+3 a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 91, normalized size = 0.86 \begin {gather*} \frac {\left (-3 a^2 d^2+2 a b c d+b^2 c^2\right ) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{5/2} d^{3/2}}-\frac {a^2}{c^2 x}-\frac {x (b c-a d)^2}{2 c^2 d \left (c+d x^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a+b x^2\right )^2}{x^2 \left (c+d x^2\right )^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.80, size = 305, normalized size = 2.88 \begin {gather*} \left [-\frac {4 \, a^{2} c^{2} d^{2} + 2 \, {\left (b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + 3 \, a^{2} c d^{3}\right )} x^{2} - {\left ({\left (b^{2} c^{2} d + 2 \, a b c d^{2} - 3 \, a^{2} d^{3}\right )} x^{3} + {\left (b^{2} c^{3} + 2 \, a b c^{2} d - 3 \, a^{2} c d^{2}\right )} x\right )} \sqrt {-c d} \log \left (\frac {d x^{2} + 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right )}{4 \, {\left (c^{3} d^{3} x^{3} + c^{4} d^{2} x\right )}}, -\frac {2 \, a^{2} c^{2} d^{2} + {\left (b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + 3 \, a^{2} c d^{3}\right )} x^{2} - {\left ({\left (b^{2} c^{2} d + 2 \, a b c d^{2} - 3 \, a^{2} d^{3}\right )} x^{3} + {\left (b^{2} c^{3} + 2 \, a b c^{2} d - 3 \, a^{2} c d^{2}\right )} x\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right )}{2 \, {\left (c^{3} d^{3} x^{3} + c^{4} d^{2} x\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 102, normalized size = 0.96 \begin {gather*} \frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c^{2} d} - \frac {b^{2} c^{2} x^{2} - 2 \, a b c d x^{2} + 3 \, a^{2} d^{2} x^{2} + 2 \, a^{2} c d}{2 \, {\left (d x^{3} + c x\right )} c^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.03, size = 131, normalized size = 1.24 \begin {gather*} -\frac {a^{2} d x}{2 \left (d \,x^{2}+c \right ) c^{2}}-\frac {3 a^{2} d \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \sqrt {c d}\, c^{2}}+\frac {a b x}{\left (d \,x^{2}+c \right ) c}+\frac {a b \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d}\, c}-\frac {b^{2} x}{2 \left (d \,x^{2}+c \right ) d}+\frac {b^{2} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \sqrt {c d}\, d}-\frac {a^{2}}{c^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.49, size = 100, normalized size = 0.94 \begin {gather*} -\frac {2 \, a^{2} c d + {\left (b^{2} c^{2} - 2 \, a b c d + 3 \, a^{2} d^{2}\right )} x^{2}}{2 \, {\left (c^{2} d^{2} x^{3} + c^{3} d x\right )}} + \frac {{\left (b^{2} c^{2} + 2 \, a b c d - 3 \, a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.19, size = 128, normalized size = 1.21 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{\sqrt {c}\,\left (-3\,a^2\,d^2+2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (3\,a\,d+b\,c\right )}{2\,c^{5/2}\,d^{3/2}}-\frac {\frac {a^2}{c}+\frac {x^2\,\left (3\,a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,c^2\,d}}{d\,x^3+c\,x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.87, size = 238, normalized size = 2.25 \begin {gather*} \frac {\sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (- \frac {c^{3} d \sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} - \frac {\sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right ) \log {\left (\frac {c^{3} d \sqrt {- \frac {1}{c^{5} d^{3}}} \left (a d - b c\right ) \left (3 a d + b c\right )}{3 a^{2} d^{2} - 2 a b c d - b^{2} c^{2}} + x \right )}}{4} + \frac {- 2 a^{2} c d + x^{2} \left (- 3 a^{2} d^{2} + 2 a b c d - b^{2} c^{2}\right )}{2 c^{3} d x + 2 c^{2} d^{2} x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________